<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加上课人员</title>
<meta name="renderer" content="webkit">	
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
<meta name="apple-mobile-web-app-status-bar-style" content="black">	
<meta name="apple-mobile-web-app-capable" content="yes">	
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/table.css">
<link rel="stylesheet" href="css/calendar.css">
</head>
<body>
<div class="content-head">悦宝园会员管理系统</div>
<div class="content-main">
	<div class="side-nav" ms-controller="navBar">
		<ul class="nav-item">
			<li><a href="main.html" class="nav-item-front nav-item-add">首页</a></li>
			<li ms-for="el in @navTitleArr">
				<a href="javascript:;" class="nav-item-front">{{el.par}}</a>
				<dl class="nav-item-child">
					<dd ms-for="($index, ex) in el.child"><a ms-attr='{href: el.href[$index]}'>{{ex}}</a></dd>
				</dl>
			</li>
		</ul>
	</div>
	<div class="content bg-gray" ms-controller="main">
		<div class="tab-content">
			<div class="tab-item">
				<div class="sub-main">
					<p class="sub-title"><i>添加上课人员</i></p>
					<div>
						<div class="week_content">
							<div class="week_title" id="week_title" ids="0">
								<a href="javascript:void(0)" id="prevWeek"></a>
								<h1 id="showDate"></h1>
								<a href="javascript:void(0)" id="nextWeek" class="nextWeek"></a>
							</div>
							<div class="week_box">
								<ul class="clear" id="weekUl"></ul>
							</div>
							<div class="calendar_box clear" id="calendarBox"></div>
						</div>
					</div>
					<div class="schedule-body">
						<div class="schedule-btns">
							<a href="javascript:;" id="subForm">确认添加</a>
							<a href="javascript:;" id="outputExcel" style="float: right;">生成Excel</a>
						</div>
						<table>
							<tbody id="scheduleBody">
								<tr>
									<td valign="top" width="59">时间</td>
									<td valign="top" width="92">老师</td>
									<td valign="top" width="323">姓名</td>
									<td valign="top" width="323">电话</td>
									<td valign="top" width="323">状态</td>
									<td valign="top" width="199">操作</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div> 
</div>
<div class='mask hide' id="mask"></div>
<div class="mask-content hide" id="memberContent" style="width: 450px; height: 280px;">
	<div class="tab-btns">
		<span><input name="type" type="radio" checked="checked" id="member">会员</span>
		<span><input name="type" type="radio" id="reMember">非会员</span>
	</div>
	<form id="addClassForm">
		<div class="mask-info-line" id="member-area" style="text-align:center;">
			<div class="searchResultArea">
				<input type="text" style="height: 25px; width: 426px;font-size: 18px;text-align: center;" placeholder="姓名或小名" id="searchInput"/>
			</div>
		</div>
		<div class="hide" id="reMember-area">
			<div class="import-block">
				<span class="import-name">姓名：</span>
				<div class="import-input">
					<input type="text" maxlength="10" id="name">
				</div>
			</div>
			<div class="import-block">
				<span class="import-name">月龄：</span>
				<div class="import-input">
					<input type="text" maxlength="20" id="old">
				</div>
			</div>
			<div class="import-block">
				<span class="import-name">所属顾问：</span>
				<div class="import-input">
					<select id="cc">
						<option value="Maggie" selected="selected">Maggie</option>
						<option value="Cora">Cora</option>
						<option value="Anna">Anna</option>
						<option value="Lisa">Lisa</option>
						<option value="Mia">Mia</option>
						<option value="Katie">Katie</option>
						<option value="Ivy">Ivy</option>
						<option value="Lucas">Lucas</option>
						<option value="Amy">Amy</option>
					</select>
				</div>
			</div>
			<div class="import-block">
				<span class="import-name"></span>
				<div class="import-input">
					<a href="javascript:;" class="import-btn" id="reMemberConfirm">确认</a>
				</div>
			</div>
		</div>
	</form>
</div>
<div class="mask-content teacher-content hide" id="teacherContent" style="width: 450px; height: 280px;">
	<p>主教老师：</p>
	<div>
		<span data-type="one" data-name="annie">Annie</span>
		<span data-type="one" data-name="serina">Serina</span>
		<span data-type="one" data-name="lily">Lily</span>
		<span data-type="one" data-name="rainbow">Rainbow</span>
		<span data-type="one" data-name="candy">Candy</span>
		<span data-type="one" data-name="vannesa">Vannesa</span>
	</div>
	<p>助教老师：</p>
	<div>
		<span data-type="two" data-name="annie">Annie</span>
		<span data-type="two" data-name="serina">Serina</span>
		<span data-type="two" data-name="lily">Lily</span>
		<span data-type="two" data-name="rainbow">Rainbow</span>
		<span data-type="two" data-name="candy">Candy</span>
		<span data-type="two" data-name="vannesa">Vannesa</span>
	</div>
	<a href="javascript:;" class="teacher-confirm">确认</a>
</div>
<script src="js/jq.js"></script>
<script src="js/avalon.js"></script>
<script src="js/main.js"></script>
<script src="js/calendar.js"></script>
<script src="js/xlsx.full.min.js"></script>
<script>
(function() {
	var cDate;
	var sData;
	var sObj = {};
	var scheduleData = baseFunc.getStorageData("schedule");
	var clickObj;
	var clickTime;
	var students = [];
	var teachers = [];
	var tempStudent = {};

	//初始化日历
	var sDate = baseFunc.getStorageData("schedule");
	var testData = [];
	if (sDate) {
		for (var i = 0; i < sDate.length; i++) {
			testData.push({date: sDate[i].date, items: [{className:'已创建课表'}]});
		};
	};

	weeklyCalendar(testData, {
		// 点击日期回调
		clickDate: function (date) {
			cDate = date;
			sData = "";
			var data,
				htmls = "",
				classNum = 0,
				cc = false;

			$(".delete").remove();
			if(!scheduleData) {
				return;
			}

			for (var i = 0; i < scheduleData.length; i++) {
				if(scheduleData[i].date == cDate) {
					data = sData = scheduleData[i];
					cc = true;
					break;
				}
			};

			if(!cc) {
				baseFunc.alert("没有数据");
				return;
			}

			var sTeacher = "",
				sName,
				sNickname,
				sTel,
				sStatus,
				sInfo,
				iSame = true;
			for (var k = 0; k < data["info"].length; k++) {
				if(data["info"][k].classType == "gym") {
					classNum = 11;
				} else {
					classNum = 9;
				}
				sTeacher = "";
				if(data["info"][k]["teachers"]) {
					$.each(data["info"][k]["teachers"], function(i, elem) {
						if(i == 0) {
							sTeacher = elem["name"];
						} else if (i == 1) {
							sTeacher = sTeacher + "," + elem["name"];
						}
						
					})
				}
				//初始化表格
				htmls = '<tr class="delete"><td rowspan="'+classNum+'" valign="top" width="59"><p style="font-size: 12px; font-weight: bold;">'+data["info"][k]["time"]+'</p><p style="font-size: 12px;">'+data["info"][k]["classFullName"]+'</p></td><td data-type="teacher" class="addMember" data-info="'+cDate+','+data["info"][k]["time"]+','+data["info"][k]["className"]+','+data["info"][k]["classFullName"]+'" rowspan="'+classNum+'" valign="top" width="92">'+sTeacher+'</td>';

				for (var q = 0; q < classNum; q++) {
					sName = sTel = sStatus = sInfo = "";
					iSame = true;
					sBtn = '<td></td>';
					if(data["info"][k]["students"] && q < data["info"][k]["students"].length) {
						sName = data["info"][k]["students"][q]["name"];
						sNickname = data["info"][k]["students"][q]["nickName"];
						sName = sNickname ? sName + "(" + sNickname + ")" : sName;
						sBtn = '<td><a href="javascript:;" class="deleteMember">取消</a></td>';
						if(data["info"][k]["students"][q]["tel"]) {
							sTel = data["info"][k]["students"][q]["tel"] ? data["info"][k]["students"][q]["tel"] : "";
						}
						if(data["info"][k]["students"][q]["cc"]) {
							sStatus = data["info"][k]["students"][q]["cc"] ? data["info"][k]["students"][q]["cc"] : "";
						} else {
							//会员首次上课判断
							var firstArr = baseFunc.getStorageData("member", {flag: data["info"][k]["students"][q]["flag"]})[0]["firstClass"] || "";
							if(!firstArr) {
								sStatus = "首次上本课程";
							} else {
								for (var x = 0; x < firstArr.length; x++) {
									if(firstArr[x].className == data["info"][k]["className"]) {
										iSame = false;
									}
								};
								sStatus = iSame ? "首次上本课程" : "";
							}
						}
					}
					if(data["info"][k]["students"] && q < data["info"][k]["students"].length) {
						if(data["info"][k]["students"][q].flag) {
							sInfo = data["info"][k]["students"][q]["flag"];
						} else {
							sInfo = JSON.stringify(data["info"][k]["students"][q]);
						}
					}
					if(q == 0) {
						htmls += '<td data-type="member" class="addMember" data-info="'+cDate+','+data["info"][k]["time"]+','+data["info"][k]["className"]+','+data["info"][k]["classFullName"]+'" data-moreInfo='+sInfo+' valign="top" width="199">'+sName+'</td><td valign="top" width="323">'+sTel+'</td><td valign="top" width="323">'+sStatus+'</td>' + sBtn + '</tr>';
					} else {
						htmls += '<tr class="delete"><td valign="top" data-type="member" class="addMember" data-info="'+cDate+','+data["info"][k]["time"]+','+data["info"][k]["className"]+','+data["info"][k]["classFullName"]+'" data-moreInfo='+sInfo+'>'+sName+'</td><td valign="top" width="323">'+sTel+'</td><td valign="top" width="323">'+sStatus+'</td>' + sBtn + '</tr>';
					}
				};

				$("#scheduleBody").append(htmls);
			};
		},
		// 点击弹窗回调
		clickDownLoad: function (that) {
			console.log(that)
		}
	}, true);

	$(".current").trigger("click");

	//选项卡切换
	$(".tab-btns").find("input").click(function() {
		var id = $(this).attr("id");
		$("#member-area").addClass("hide");
		$("#reMember-area").addClass("hide");
		$("#" + id + "-area").removeClass("hide");
	});

	//增加人员
	$("body").on("click", ".addMember", function() {
		var type = $(this).attr("data-type");
		clickObj = $(this);
		clickTime = $(this).attr("data-info");

		if(type == "teacher") {
			$("#mask").removeClass("hide");
			$("#teacherContent").removeClass("hide");
		} else {
			$("#mask").removeClass("hide");
			$("#memberContent").removeClass("hide");
			$("#searchInput").trigger("focus");
		}
	});

	//取消人员
	$("body").on("click", ".deleteMember", function() {
		$(this).parent().parent().find("td").each(function(i, elem) {
			if(!$(elem).attr("rowspan")) {
				$(elem).text("");
			}
		});
	});

	//关闭
	$(".mask").click(function() {
		$("#mask").addClass("hide");
		$("#teacherContent").addClass("hide");
		$("#memberContent").addClass("hide");
	});

	//选择老师
	$(".teacher-content span").click(function() {
		if($(this).hasClass("add")) {
			$(this).removeClass("add");
		} else {
			$(this).addClass("add");
		}
	});

	//老师提交
	$(".teacher-confirm").click(function() {
		var tempStr= "";
		var teacherArr = [];
		$(".teacher-content").find(".add").each(function() {
			var tempObj = {};
			var type = $(this).attr("data-type");
			var name = $(this).attr("data-name");
			tempObj.name = name;
			teacherArr.push(tempObj);
		});

		tempStr = teacherArr[0].name;
		if(teacherArr.length > 1) {
			tempStr = tempStr + "," + teacherArr[1].name;
		}

		clickObj.html(tempStr);

		$("#mask").addClass("hide");
		$("#teacherContent").addClass("hide");
		$("#memberContent").addClass("hide");
		$(".teacher-content").find("span").removeClass("add");
	});

	//提交
	$("#subForm").click(function() {
		teachers = [];
		students = {};
		var tempObj = {};
		if(!sData) {
			baseFunc.alert("请先选择课表");
			return;
		}

		if(sData.passStatus) {
			baseFunc.alert("该课表已核销，无法修改");
			return;
		}
		
		//先清空学生信息
		for (var i = 0; i < sData.info.length; i++) {
			sData.info[i].students = [];
		};

		$(".addMember").each(function() {
			var Dtrue = $(this).text() != "";
			if(Dtrue) {
				var elem = $(this),
					type = elem.attr("data-type"),
					info = elem.attr("data-info").split(","),
					time = info[1],
					className = info[2],
					classFullName = info[3];

				if(type == "teacher") {
					var tempTeacher = elem.text().split(",");
					teachers.push({
						type: "one",
						name: tempTeacher[0]
					})
					if (tempTeacher.length > 1) {
						teachers.push({
							type: "two",
							name: tempTeacher[1]
						})
					};
					//老师信息导入相关课程信息
					for(var i = 0; i < sData["info"].length; i++) {
						if(sData["info"][i].time == time && sData["info"][i].className == className) {
							sData["info"][i]["teachers"] = teachers;
							break;
						}
					}
					teachers = [];
				} else if (type == "member") {
					var moreInfo = $(this).attr("data-moreInfo").search("{") == -1 ? $(this).attr("data-moreInfo") : JSON.parse($(this).attr("data-moreInfo"));
					
					if(moreInfo.cc) {
						students = {
							type: "reMember",
							name: moreInfo.name,
							cc: moreInfo.cc,
							month: moreInfo.old
						};
					} else {
						moreInfo = baseFunc.getStorageData("member", {flag: moreInfo})[0];
						students = {
							type: "member",
							name: moreInfo.name,
							nickName: moreInfo.nickName,
							flag: moreInfo.flag,
							tel: moreInfo.tel,
							strClass: moreInfo.strClass,
							allData: JSON.stringify(moreInfo)
						};
					}
					//约课学生信息导入相关课程信息
					for(var i = 0; i < sData["info"].length; i++) {
						if(sData["info"][i].time == time && sData["info"][i].className == className) {
							sData["info"][i]["students"].push(students);
							break;
						}
					}
					students = {};
				}

			}
		});
		if(sData) {
			baseFunc.editStorageData("schedule", sData);
			baseFunc.alert("添加成功", "green");
		}
	});

	//非会员确认
	$("#reMemberConfirm").click(function() {
		var name = $.trim($("#name").val()),
			old = $.trim($("#old").val()),
			cc = $("#cc option:selected").attr("value");

		if(name == "") {
			$("#mask").addClass("hide");
			$("#teacherContent").addClass("hide");
			$("#memberContent").addClass("hide");
			$("#name").val("");
			$("#old").val("");
			$("#searchInput").val("");
			$(".tempAppend").remove();
			$(".tab-btns").find("input").attr("checked", false);
			$(".tab-btns").find("input").eq(0).prop("checked", "checked");
			$("#member-area").addClass("hide");
			$("#reMember-area").addClass("hide");
			$("#member-area").removeClass("hide");
			return;
		} 
		tempStudent.name = name;
		tempStudent.old = old;
		tempStudent.cc = cc;
		tempStudent.type = "reMember";
		clickObj.attr("data-moreInfo", JSON.stringify(tempStudent));
		clickObj.text(name + "(试听)");
		clickObj.next().next().text(cc);
		clickObj.next().next().next().html('<a href="javascript:;" class="deleteMember">取消</a>');
		$("#mask").addClass("hide");
		$("#teacherContent").addClass("hide");
		$("#memberContent").addClass("hide");
		$("#name").val("");
		$("#old").val("");
		$("#searchInput").val("");
		$(".tempAppend").remove();
		$(".tab-btns").find("input").attr("checked", false);
		$(".tab-btns").find("input").eq(0).prop("checked", "checked");
		$("#member-area").addClass("hide");
		$("#reMember-area").addClass("hide");
		$("#member-area").removeClass("hide");
		tempStudent = {};
	});

	//搜索框事件
	$("body").on("focusout", "#searchInput", function() {
		clearInterval(setInter);
	});

	$("body").on("focusin", "#searchInput", function() {
		var that = $(this),
			searchResult = "";
		setInter = setInterval(function() {
			value = that.val();
			if(value) {
				var text = "";
				searchResultName = baseFunc.getStorageData("member", {name: value}, "dim");
				searchResultNicname = baseFunc.getStorageData("member", {nickName: value}, "dim");
				// if(searchResultName.flag != searchResultNicname.flag) {
				// 	searchResult = searchResultName.concat(searchResultNicname);
				// } else {
				// 	searchResult = searchResultName;
				// }
				searchResult = searchResultName.concat(searchResultNicname);
				
				length = searchResult.length > 6 ? 6 : searchResult.length;

				if(length == 0) {
					$(".tempAppend").remove();
				} else if(length > 0) {
					for(var i = 0; i < length; i++) {
						text += "<div class='tempAppend' data-flag='"+searchResult[i].flag+"*"+searchResult[i].name+"*"+searchResult[i].nickName+"*"+searchResult[i].birthday+"*"+searchResult[i].tel+"'><span class='col-15'>"+searchResult[i].name+"</span><span class='col-15'>"+searchResult[i].nickName+"</span><span class='col-35'>"+searchResult[i].birthday+"</span><span class='col-35'>"+searchResult[i].tel+"</span></div>";
					}
					$(".tempAppend").remove();
					that.after(text);

					//选择上课学生
					$(".tempAppend").click(function() {
						newInfo = $(this).attr("data-flag").split("*");
						var resultObj = baseFunc.getStorageData("member", {flag: newInfo[0]})[0];
						var status = "";
						var name = "";
						var clickObjInfo = clickObj.attr("data-info").split(",");//[日期，时间，课程]
						var tempObj = {};
						var first = true;

						//判断是否为首次上课
						if(!resultObj["firstClass"]) {
							status = "首次";
						} else {
							for(var i = 0; i < resultObj["firstClass"].length; i++) {
								if(resultObj["firstClass"][i]["className"] == clickObjInfo[2]) {
									first = false;
									status = "";
									break;
								}
							}
							if(first) {
								status = "首次";
							}
							//最终消课时把首次上课状态关联到会员信息
						}
						//判断是否在升班状态内
						var currentClass = clickObjInfo[2];
						if(resultObj.upClassInfo[currentClass]) {
							if(resultObj.upClassInfo[currentClass][2] == "inTips") {
								status += ", 观察期";
							} else if(resultObj.upClassInfo[currentClass][2] == "inConfirm") {
								status += ", 升班";
							}
						}

						clickObj.attr("data-moreInfo", resultObj.flag);

						$("#mask").addClass("hide");
						$("#teacherContent").addClass("hide");
						$("#memberContent").addClass("hide");
						$("#searchInput").val("");
						$(".tempAppend").remove();

						if(resultObj["nickName"] != "") {
							name = resultObj["name"] + "(" + resultObj["nickName"] +")";
						} else {
							name = resultObj["name"];
						}

						clickObj.text(name);
						clickObj.next().text(resultObj["tel"]);
						clickObj.next().next().text(status);
						clickObj.next().next().next().html('<a href="javascript:;" class="deleteMember">取消</a>');
						newInfo = [];
					});
				} 
			}
		}, 500);
	});

	/******************* Excel表格操作 *****************/
	
	function sheet2blob(sheet, sheetName) {
	    sheetName = sheetName || 'sheet1';
	    var workbook = {
	        SheetNames: [sheetName],
	        Sheets: {}
	    };
	    workbook.Sheets[sheetName] = sheet;
	    // 生成excel的配置项
	    var wopts = {
	        bookType: 'xlsx', // 要生成的文件类型
	        bookSST: false, // 是否生成Shared String Table，官方解释是，如果开启生成速度会下降，但在低版本IOS设备上有更好的兼容性
	        type: 'binary'
	    };
	    var wbout = XLSX.write(workbook, wopts);
	    var blob = new Blob([s2ab(wbout)], {type:"application/octet-stream"});
	    // 字符串转ArrayBuffer
	    function s2ab(s) {
	        var buf = new ArrayBuffer(s.length);
	        var view = new Uint8Array(buf);
	        for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
	        return buf;
	    }
	    return blob;
	}

	function openDownloadDialog(url, saveName) {
	    if(typeof url == 'object' && url instanceof Blob)
	    {
	        url = URL.createObjectURL(url); // 创建blob地址
	    }
	    var aLink = document.createElement('a');
	    aLink.href = url;
	    aLink.download = saveName || ''; // HTML5新增的属性，指定保存文件名，可以不要后缀，注意，file:///模式下不会生效
	    var event;
	    if(window.MouseEvent) event = new MouseEvent('click');
	    else
	    {
	        event = document.createEvent('MouseEvents');
	        event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
	    }
	    aLink.dispatchEvent(event);
	}

	function rowspanFun(data, nameList) {
		for (var i = 0; i < nameList.length; i++) {
			var name = nameList[i];
			var startRow = 0;
			var endRow = data.length;
			var mergeNum = 1;
			if (endRow != 1) {
				for (var j = startRow; j < endRow; j++) {
					if (j == endRow - 1) { //判断是否是最后一个元素
						if (startRow == endRow - 1) {
							data[j][name + 'Rowspan'] = 1;
						}
					} else {
						if (data[startRow][name] == data[j + 1][name]) {
							data[j + 1][name + 'Rowspan'] = 0;
							mergeNum = mergeNum + 1;
							data[startRow][name + 'Rowspan'] =mergeNum;
						} else {
							startRow = j + 1;
							if (mergeNum > 1) {
								data[startRow][name + 'Rowspan'] = 1;
							} else {
								data[j][name + 'Rowspan'] = 1;
							}
							mergeNum = 1;
						}
					}
				}
			} else {
				data[0][name + 'Rowspan'] = 1;
			}
		}
		return data;
	}

	$("#outputExcel").click(function() {
		aoa = [];
		tempAoa = [];
		var mergeClumn = [];
		var tempObj = {};
		if(!sData) {
			baseFunc.alert("请先选择课表");
			return;
		}

		aoa.push(['日期', '时间', '课程', '主教', '助教', '宝贝姓名', '小名', '生日', '签到', '备注']);

		for (var i = 0; i < sData["info"].length; i++) {
			var classFullName = sData["info"][i].classFullName,
				students = sData["info"][i].students || [],
				teachers = sData["info"][i].teachers || [];
			if(students.length > 0) {
				mergeClumn.push(students.length);
				for (var k = 0; k < students.length; k++) {
					var type = students[k].type;
					tempAoa = [];
					tempAoa.push(sData["date"]);
					tempAoa.push(sData["info"][i].time);
					tempAoa.push(sData["info"][i].classFullName);

					for (var t = 0; t < 2; t++) {
						tempAoa.push(teachers[t] ? teachers[t].name : "");
					}
					tempAoa.push(students[k].name);
					tempAoa.push(students[k].nickName ? students[k].nickName : "");
					tempAoa.push(students[k].allData ? JSON.parse(students[k].allData).birthday : students[k].month);
					tempAoa.push("");//签到
					tempAoa.push(students[k].cc ? students[k].cc : "");//判断第一次状态

					aoa.push(tempAoa);
				}
			}
		}

		var sheet = XLSX.utils.aoa_to_sheet(aoa);

		sheet['!merges'] = [];
		sheet['!merges'].push({s: {r: 1, c: 0}, e: {r: aoa.length - 1, c: 0}});
		var idx = 1;
		for (var i = 0; i < mergeClumn.length; i++) {
			sheet['!merges'].push({s: {r: idx, c: 1}, e: {r: idx + mergeClumn[i] - 1, c: 1}});
			sheet['!merges'].push({s: {r: idx, c: 2}, e: {r: idx + mergeClumn[i] - 1, c: 2}});
			sheet['!merges'].push({s: {r: idx, c: 3}, e: {r: idx + mergeClumn[i] - 1, c: 3}});
			sheet['!merges'].push({s: {r: idx, c: 4}, e: {r: idx + mergeClumn[i] - 1, c: 4}});
			idx = idx + mergeClumn[i];
		}
		sheet["A2"].s = {vertical:'center', horizontal:'center'};
		openDownloadDialog(sheet2blob(sheet), cDate+'约课表.xlsx');
	});
})();
</script>
</body>
</html>